home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Partner Applications.iso / SunLabs / tclTK / src / tk4.0 / tests / canvPsBmap.tcl < prev    next >
Encoding:
Text File  |  1995-01-31  |  2.5 KB  |  63 lines

  1. # This file creates a screen to exercise Postscript generation
  2. # for bitmaps in canvases.  It is part of the Tk visual test suite,
  3. # which is invoked via the "visual" script.
  4. #
  5. # @(#) canvPsBmap.tcl 1.2 95/01/30 22:05:13
  6.  
  7. catch {destroy .t}
  8. toplevel .t
  9. wm title .t "Postscript Tests for Canvases"
  10. wm iconname .t "Postscript"
  11. wm geom .t +0+0
  12. wm minsize .t 1 1
  13.  
  14. set c .t.c
  15.  
  16. message .t.m -text {This screen exercises the Postscript-generation abilities of Tk canvas widgets for bitmaps.  Click on "Print" to print the canvas to your default printer.  You can click on items in the canvas to delete them.} -width 6i
  17. pack .t.m -side top -fill both
  18.  
  19. frame .t.bot
  20. pack .t.bot -side bottom -fill both
  21. button .t.bot.quit -text Quit -command {destroy .t}
  22. button .t.bot.print -text Print -command "lpr $c"
  23. pack .t.bot.print .t.bot.quit -side left -pady 1m -expand 1
  24.  
  25. canvas $c -width 6i -height 6i -bd 2 -relief sunken
  26. pack $c -expand yes -fill both -padx 2m -pady 2m
  27.  
  28. $c create bitmap 0.5i 0.5i -bitmap @$tk_library/demos/images/flagdown \
  29.     -background {} -foreground black -anchor nw
  30. $c create rect 0.47i 0.47i 0.53i 0.53i -fill {} -outline black
  31.  
  32. $c create bitmap 3.0i 0.5i -bitmap @$tk_library/demos/images/flagdown \
  33.     -background {} -foreground black -anchor n
  34. $c create rect 2.97i 0.47i 3.03i 0.53i -fill {} -outline black
  35.  
  36. $c create bitmap 5.5i 0.5i -bitmap @$tk_library/demos/images/flagdown \
  37.     -background black -foreground white -anchor ne
  38. $c create rect 5.47i 0.47i 5.53i 0.53i -fill {} -outline black
  39.  
  40. $c create bitmap 0.5i 3.0i -bitmap @$tk_library/demos/images/face \
  41.     -background {} -foreground black -anchor w
  42. $c create rect 0.47i 2.97i 0.53i 3.03i -fill {} -outline black
  43.  
  44. $c create bitmap 3.0i 3.0i -bitmap @$tk_library/demos/images/face \
  45.     -background {} -foreground black -anchor center
  46. $c create rect 2.97i 2.97i 3.03i 3.03i -fill {} -outline black
  47.  
  48. $c create bitmap 5.5i 3.0i -bitmap @$tk_library/demos/images/face \
  49.     -background blue -foreground black -anchor e
  50. $c create rect 5.47i 2.97i 5.53i 3.03i -fill {} -outline black
  51.  
  52. $c create bitmap 0.5i 5.5i -bitmap @$tk_library/demos/images/flagup \
  53.     -background black -foreground white -anchor sw
  54. $c create rect 0.47i 5.47i 0.53i 5.53i -fill {} -outline black
  55.  
  56. $c create bitmap 3.0i 5.5i -bitmap @$tk_library/demos/images/flagup \
  57.     -background green -foreground white -anchor s
  58. $c create rect 2.97i 5.47i 3.03i 5.53i -fill {} -outline black
  59.  
  60. $c create bitmap 5.5i 5.5i -bitmap @$tk_library/demos/images/flagup \
  61.     -background {} -foreground black -anchor se
  62. $c create rect 5.47i 5.47i 5.53i 5.53i -fill {} -outline black
  63.